package com.tgit.sso.paltform.config;

import com.alibaba.druid.support.http.StatViewServlet;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;


/**
 * 
* @ClassName: DruidServletConfig   
* @Description: TODO(Druid配置)   
* @author 范再军  
* @date 2018年4月17日 下午12:42:15   
*
 */
@Configuration
public class DruidServletConfig extends SpringBootServletInitializer {

    @Bean
    @Order
    public ServletRegistrationBean statViewServlet() {
        StatViewServlet servlet = new StatViewServlet();
        ServletRegistrationBean bean = new ServletRegistrationBean(servlet, "/druid/*");
        return bean;
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(DruidServletConfig.class);
    }
}
